﻿<%@ CODEPAGE=65001 %>
<% Option Explicit %>
<% On Error Resume Next %>
<% Response.Charset="UTF-8" %>
<% Response.Buffer=True %>
<!-- #include file="..\..\..\zb_users\c_option.asp" -->
<!-- #include file="..\..\..\zb_system\function/c_function.asp" -->
<!-- #include file="..\..\..\zb_system\function/c_system_lib.asp" -->
<!-- #include file="..\..\..\zb_system\function/c_system_base.asp" -->
<!-- #include file="..\..\..\zb_system\function/c_system_plugin.asp" -->
<!-- #include file="..\..\..\zb_users\plugin/p_config.asp" -->
<%
Call System_Initialize()

If CheckPluginState("xnxf_DS")=False Then Call ShowError(48)

Dim Article,IPList,Value
Set Article=New TArticle
IPList = LoadFromFile(DS_Path("c-ip"),"utf-8")
' If InStr(IPList,Request.ServerVariables("REMOTE_ADDR")) > 0 Then
  ' Response.Write "{""code"":""check"",""text"":""已经赞过了!!!""}"
' Else
If Article.LoadInfoByID(FilterSQL(Request.QueryString("id"))) Then
  Value = Cint(Article.Meta.GetValue("zan"))+1
  If Cint(Request("value")) = Value-1 Then
    Call Article.Meta.SetValue("zan",Value)
    If Article.Post Then
      Response.Write "{""code"":""ok"",""value"":"&Value&"}"
    Else
      Response.Write "{""code"":""erro"",""text"":""提交失败""}"
    End If
  Else
    Response.Write "{""code"":""check"",""text"":""已经赞过了!!""}"
  End If
  IPList = IPList & Request.ServerVariables("REMOTE_ADDR") & vbCrLf
  Call SaveToFile(DS_Path("c-ip"),IPList,"utf-8",False)
End If


'plugin node
' For Each sAction_Plugin_View_End in Action_Plugin_View_End
	' If Not IsEmpty(sAction_Plugin_View_End) Then Call Execute(sAction_Plugin_View_End)
' Next

Set Article = Nothing

Call System_Terminate()

If Err.Number<>0 then
	Call ShowError(0)
End If
%>